package org.calrissian.restdoclet.model.type;

import com.sun.javadoc.ParameterizedType;
import com.sun.javadoc.Type;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by admin on 2017/9/1.
 */
public class ParamTypeInfo {

    private String fullTypeName;

    private Map<String, Type> symbolParamTypeMap = new HashMap<>();

    public void addSymbolTypePair(String typeVariableName, Type type) {
        symbolParamTypeMap.put(typeVariableName, type);
    }

    public Type getParamType(String symbol) {
        return symbolParamTypeMap.get(symbol);
    }

    public String getFullTypeName() {
        return fullTypeName;
    }

    public void setFullTypeName(String fullTypeName) {
        this.fullTypeName = fullTypeName;
    }

    public Map<String, Type> getSymbolParamTypeMap() {
        return symbolParamTypeMap;
    }

    @Override
    public boolean equals(Object obj) {
        if(obj == null) {
            return false;
        }
        if(!(obj instanceof ParamTypeInfo)) {
            return false;
        }
        ParamTypeInfo other = (ParamTypeInfo) obj;
        return this.fullTypeName.equals(other.getFullTypeName());
    }
}
